<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
     let num = 0,n
    function time( num ){
         while( true ){
             num = +prompt(`请输入总秒数:`)
             if( num < 0 ){
                 alert(`不符合规范，请重新输入，谢谢！`)
             }
             else{
                 break
             }
         }
         let day = parseInt( num / 86400 )
         let hour = parseInt( num / 3600 % 24 )
         let minute = parseInt( num / 60 % 60) 
         let second = parseInt( num % 60 )
         function clock( n ){
             return n < 10 ? '0' + n : n
         }
         return `${clock(day)}天${clock(hour)}时${clock(minute)}分${clock(second)}秒`
     }
     let result = time(parseInt(num))
     document.write(`转换完后为${result}`)
     </script>
</body>
</html>